package com.jt.Demo06.mapper;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Repository;

@Repository

//spring根据指定的路径,加载properties配置文件 数据添加到spring容器中
@PropertySource(value = "classpath:/addUser.properties",encoding = "UTF-8")

public class UserMapperImpl implements UserMapper{
    @Value("${name}")  //为属性赋值  从spring容器中动态获取
    private String name;
    @Override
    public void addUser() {
        System.out.println("新增用户成功"+name);
    }
}
